package cn.wolfcode.luowowo.scenic.domain;

import cn.wolfcode.luowowo.article.domain.Destination;
import cn.wolfcode.luowowo.common.domain.BaseDomain;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class Scenic extends BaseDomain{

    private String name; // 景区名字

    private String enName; // 景区英文名

    private String summary; // 景区简短介绍

    private String introduce; // 景区介绍

    private String tele; // 景区电话

    private String website; // 景区网址

    private Long useTime; // 旅游花费时间

    private String travel; // 交通 traffic

    private String openTime; // 开门时间

    private String location; // 地址

    private Destination dest; // 该景点关联的目的地

    private ScenicTheme scenicTheme; //该景点关联的主题

    private String ticket; // 门票

    private String coverUrl; // 该景点图片url

    // 该景点的统计数据
    private int synStarnum;
    private int sceneryStarnum;
    private int featureStarnum;
    private int serviceStarnum;
    private int commentnum;

    public List<String> getPhotoUrl(){
        String[] split = coverUrl.trim().split(",");
        List<String> objects = new ArrayList<>();
        for (String s : split) {
            objects.add(s.trim());
        }
        return objects;
    }
    public String getUseTimeString(){
        if(useTime != null){
            if(useTime == 0L){
                return "1 ~ 3小时";
            }
            if(useTime == 1L){
                return "3小时以上";
            }
        }
        return "未知";
    }
}